#include "myvector.h"

namespace real 
{
    void TestVector1()
    {
        vector<double> v;
        v.push_back(1);
        v.push_back(2);
        v.push_back(3);
        print_container(v.begin(), v.end());
        v.push_back(4);
        v.push_back(5);
        print_container(v.begin(), v.end());
    }

    void TestVector2()
    {
        vector<std::string> v;
        v.push_back("11");
        v.push_back("22");
        v.push_back("33");
        print_container(v.begin(), v.end());
        v.push_back("44");
        v.push_back("55");
        print_container(v.begin(), v.end());

        vector <std::string> vs = v;
        print_container(vs.begin(), vs.end());

        delete [] v.begin();
        // print_container(v.begin(), v.end());

        print_container(vs.begin(), vs.end());

        vector<float> v3 = 1.1f;
        v3.push_back(2.2f);
        v3.push_back(3.2f);
        v3.push_back(4.2f);
        v3.push_back(5.2f);
        v3.push_back(6.6f);
        print_container(v3.begin(), v3.end());

        vector<float> v4 = 11.1f;
        print_container(v4.begin(), v4.end());
        v4 = v3;
        print_container(v4.begin(), v4.end());
    }

    void TestVector3()
    {
        vector<int> v;
        cout << v.empty() << endl;
        v.push_back(1);
        v.push_back(2);
        v.push_back(3);
        v.push_back(4);
        v.push_back(5);
        v.push_back(6);
        v.push_back(7);
        cout << v[v.size()-1] << endl;
        v[v.size()-1] *= 10 ;
        vector<int> vd;
        vd = v;

        cout << v[v.size()-1] << endl;
        print_container(v.begin(),v.end());

        v.erase(v.end()-1);
        print_container(v.begin(),v.end());

        v.erase(v.begin()+1, v.end());
        print_container(v.begin(),v.end());

        print_container(vd.begin(),vd.end());
        
    }
}

int main()
{
    // real::TestVector1();
    // real::TestVector2();
    real::TestVector3();
    
    return 0;
}